<?php

    $js = new jsTool();
    $values = array($_REQUEST['name'],$_REQUEST['fname'],$_REQUEST['email'],$_REQUEST['password'],$_REQUEST['pays'],$_REQUEST['codePost']);
    foreach($values as $v){
		if(empty($v)){$js->redirect("?gts=06&ermsg=".addslashes(TXT_26));}
	}
	
	/*if(isset($_REQUEST['useCond'])&&($_REQUEST['useCond']=='on')){}
	else{$js->redirect('?gts=01&ermsg='.addslashes(TXT_27));}
	*/
	$base = new base();
	$req = $base->insertion(array("kory_users"),array('',$_REQUEST['name']
													  ,$_REQUEST['fname']
													  ,$_REQUEST['email']
													  ,$_REQUEST['password']
													  ,$USER_LANG
													  ,$_REQUEST['pays']
													  ,$_REQUEST['codePost']
													  ,'****'
													  ,'A'
													  ,time()
													  ,'',0));
													  
	$exec = $base->execution($req) or $js->redirect("?gts=06&ermsg=".addslashes(mysql_error()));
	($exec)?$js->redirect('?gts=10&uid='.mysql_insert_id().'&email='.$_REQUEST['email']):$js->redirect('?gts=06&ermsg='.addslashes(mysql_error()));
	/*
			
	$entete  ="From:".TXT_29."\n";
	$entete .= "MIME-version: 1.0\n";
	$entete .= "Content-type: text/html; charset= iso-8859-1\n";
	$mail_a = $_REQUEST['email'];
	$mail_objet = TXT_30;
	$mail_contenu = TXT_31;	
	$mail_contenu .= TXT_32;
	$mail_contenu  .= "<span style='color:blue;'>http://www.maisoneditionkory.com/v2/?gts=03&k=".mysql_insert_id()."</a></span><br/>";
	$mail_contenu  .="<br/><table><tr><td colspan='2'><b style='border-bottom:1px solid #000000;'>".TXT_33."</b></td></tr>";
	$mail_contenu  .="<tr><td><b>".TXT_37."</b></td><td>".$_REQUEST['email']."</td></tr>";
	$mail_contenu  .="<tr><td><b>".TXT_38."<b></td><td>".$_REQUEST['password']."</td></tr>";	
	$mail_contenu  .="<tr><td><b>".TXT_39."<b></td><td>".substr(md5(mysql_insert_id()),1,5)."</td></tr></table>";	
	$mail_contenu .= "<br/><br/>".TXT_34;
	$mail_contenu .= "<br/><br/>--";
	$mail_contenu .= "<br/>".TXT_35;
	
	
	if(mail($mail_a,$mail_objet,$mail_contenu,$entete)){
	   $m  ='<div id="ek4_1">';
	   $m  .='<div id="ek4_2">';
	   $m  .=TXT_28;
	   $m  .='</div>';
	   $m  .='<div id="ek4_4">';
	   $m .="<div class='ek4_4_x'>";
	   $m .=TXT_36.TXT_12.$_REQUEST['email'];
	   $m .="</div>";
	   $m .="</div>";
	   $m .="</div>";
	   echo $m;
	}else echo 'oups';
	*/
?>